#ifndef _DATA_TYPE_H_
#define _DATA_TYPE_H_

#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>

#include "stm32f4xx.h"
#include "FreeRTOS.h"

#include "soc_tim_delay.h"

#define DT_PI                   3.141592f
#define DT_INVAL_MARK           0xFF

/* SDRAM 地址分配 */
#define DT_SDRAM_FOR_RGBLCD_FRAME_BUF_ADDR     0xC0000000
#define DT_SDRAM_FOR_RGBLCD_FRAME_BUF_SIZE    (2U * 1024U * 600U)

#define DT_SDRAM_FOR_LVMEM_ADDR                0xC0200000              /* 用于 lvgl memory pool 使用 */
#define DT_SDRAM_FOR_LVMEM_SIZE               (10U * 1024U * 1024U)

#define DT_SDRAM_FOR_TEST_ADDR                 0xC0B00000

/* 返回值 */
typedef enum
{
    RET_OK = 0,
    RET_ERROR
} RET_STATUS;

/* (设备)初始化状态 */
typedef enum
{
    INIT_SUCC = 0,
    INIT_FAIL,
} INIT_STATUS;

/* 存储float */
typedef union STORE_FLOAT
{
    uint8_t buf[4];
    float   data;
} store_float_t;

/* 坐标数据 */
typedef struct DT_COORD
{
    uint16_t x;
    uint16_t y;
} dt_coord;
typedef dt_coord *dt_coord_t;

/* 3轴数据(signed int16_t) */
typedef struct DT_3AXIS_S2
{
    int16_t x;
    int16_t y;
    int16_t z;
} dt_3axis_s2;
typedef dt_3axis_s2 *dt_3axis_s2_t;

#endif
